package 适配器模式;

public class OperationAdapter implements DataOperation {

    public QuickSort qSort;
    public BinarySearch binarySearch;

    public OperationAdapter (QuickSort qSort,BinarySearch binarySearch) {
        this.qSort = qSort;
        this.binarySearch = binarySearch;
    }

    @Override
    public void sort(int[] array) {

        this.qSort.quickSort(array);
    }

    @Override
    public int search(int[] array, int key) {

        this.binarySearch.binarySearch(array,key);
        return 0;
    }
}
